const AccessTokenKey = 'ACCESS_TOKEN'
const RefreshTokenKey = 'REFRESH_TOKEN'
const UserId = 'USER_ID'
const ExpiresTime = 'EXPIRES_TIME'

export function getAccessToken() {
  return localStorage.getItem(AccessTokenKey)
}

export function getRefreshToken() {
  return localStorage.getItem(RefreshTokenKey)
}

export function setToken(token) {
  localStorage.setItem(AccessTokenKey, token.accessToken)
  localStorage.setItem(RefreshTokenKey, token.refreshToken)
  localStorage.setItem(ExpiresTime, token.expiresTime)
}

export function removeToken() {
  localStorage.removeItem(AccessTokenKey)
  localStorage.removeItem(RefreshTokenKey)
}


export function setUserId(token) {
  localStorage.setItem(UserId, token.userId)
}

export function setexpiresTime(token) {
  localStorage.setItem(ExpiresTime, token.expiresTime)
}